#ifndef __PTGUI_H__
#define __PTGUI_H__

#include <sys/list.h>

#ifdef __cplusplus
extern "C"
{
#endif

struct ptgui_widget;
struct ptgui_object;

typedef struct ptgui_object ptgui_object_t;
typedef struct ptgui_widget ptgui_widget_t;
typedef struct ptgui_container ptgui_container_t;

typedef struct ptgui_page_control* ptgui_page_control_t;

typedef ptgui_page_control_t (*ptgui_event_handler_ptr)(ptgui_widget_t *widget, pt_event_t *event);
typedef void (*ptgui_render_handler_ptr)(ptgui_widget_t *widget);
typedef void (*ptgui_frame_handler_ptr)(ptgui_widget_t *widget, pt_uint32_t fDelta);

typedef struct ptgui_point
{
	pt_int16_t	x,
				y;
} ptgui_point_t;

typedef struct ptgui_rect
{
	pt_int16_t	x1;
	pt_int16_t	y1;
	pt_int16_t	x2;
	pt_int16_t	y2;
} ptgui_rect_t;
#define ptgui_rect_width(r)		((r).x2 - (r).x1)
#define ptgui_rect_height(r)	((r).y2 - (r).y1)

typedef struct {
	pt_uint8_t r;
	pt_uint8_t g;
	pt_uint8_t b;
	pt_uint8_t a;
} ptgui_color_rgb_t;

typedef struct ptgui_palette {
	int       ncolors;
	ptgui_color_rgb_t *colors;
} ptgui_palette_t;

/* Everything in the pixel format structure is read-only */
typedef struct ptgui_pixel_format {
	ptgui_palette_t *palette;
	pt_uint8_t  BitsPerPixel;
	pt_uint8_t  BytesPerPixel;
	pt_uint8_t  Rloss;
	pt_uint8_t  Gloss;
	pt_uint8_t  Bloss;
	pt_uint8_t  Aloss;
	pt_uint8_t  Rshift;
	pt_uint8_t  Gshift;
	pt_uint8_t  Bshift;
	pt_uint8_t  Ashift;
	pt_uint32_t Rmask;
	pt_uint32_t Gmask;
	pt_uint32_t Bmask;
	pt_uint32_t Amask;

	/* RGB color key information */
	pt_uint32_t colorkey;
	/* Alpha value information (per-surface alpha) */
	pt_uint8_t  alpha;
} ptgui_pixel_format_t;

enum PTGUI_ORIENTATION
{
	PTGUI_HORIZONTAL		= 0x01,
	PTGUI_VERTICAL			= 0x02,
	PTGUI_ORIENTATION_BOTH	= PTGUI_HORIZONTAL | PTGUI_VERTICAL
};

enum PTGUI_ALIGN
{
	PTGUI_ALIGN_NOT					= 0x00,
	PTGUI_ALIGN_CENTER_HORIZONTAL	= 0x01,
	PTGUI_ALIGN_LEFT				= PTGUI_ALIGN_NOT,
	PTGUI_ALIGN_TOP					= PTGUI_ALIGN_NOT,
	PTGUI_ALIGN_RIGHT				= 0x02,
	PTGUI_ALIGN_BOTTOM				= 0x04,
	PTGUI_ALIGN_CENTER_VERTICAL		= 0x08,
	PTGUI_ALIGN_EXPAND				= 0x10,
	PTGUI_ALIGN_STRETCH				= 0x20
};

extern void pt_gui_system_init(void *user_data);

#ifdef __cplusplus
}
#endif		/* __cplusplus */

#endif

